package newmsg;

import com.intellij.openapi.wm.ToolWindow;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.TimerTask;

public class NewMsgForm {
    private JList list1;
    private JPanel panel1;
    private DefaultListModel defaultListModel = null;
    public NewMsgForm(ToolWindow toolWindow) {
        Timer timer = new Timer(5000, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if(defaultListModel != null){
                    defaultListModel.clear();
                }
                defaultListModel = GetWeiBoModel.getModel();
                list1.setModel(defaultListModel);
            }
        });
        timer.start();
        this.currentDateTime();
    }

    public void currentDateTime() {
        // Get current date and time
    }

    public JPanel getContent() {
        return panel1;
    }

}
